/**
 * Copyright (c) 2010 Simple Graph Tools contributors. All rights reserved.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * $Id$
 */
package org.sgt.testdef.impl;

import java.util.Collection;

import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.EObjectResolvingEList;
import org.eclipse.emf.ecore.util.InternalEList;
import org.sgt.coredef.Condition;
import org.sgt.coredef.ConditionableObject;
import org.sgt.coredef.CoredefPackage;
import org.sgt.coredef.Description;
import org.sgt.testdef.Requirement;
import org.sgt.testdef.TestCondition;
import org.sgt.testdef.TestConstraint;
import org.sgt.testdef.TestElement;
import org.sgt.testdef.TestPlan;
import org.sgt.testdef.TestdefPackage;


/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Test Plan</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link org.sgt.testdef.impl.TestPlanImpl#getName <em>Name</em>}</li>
 *   <li>{@link org.sgt.testdef.impl.TestPlanImpl#getSummary <em>Summary</em>}</li>
 *   <li>{@link org.sgt.testdef.impl.TestPlanImpl#getID <em>ID</em>}</li>
 *   <li>{@link org.sgt.testdef.impl.TestPlanImpl#getDescription <em>Description</em>}</li>
 *   <li>{@link org.sgt.testdef.impl.TestPlanImpl#getPreConditions <em>Pre Conditions</em>}</li>
 *   <li>{@link org.sgt.testdef.impl.TestPlanImpl#getPostConditions <em>Post Conditions</em>}</li>
 *   <li>{@link org.sgt.testdef.impl.TestPlanImpl#getProject <em>Project</em>}</li>
 *   <li>{@link org.sgt.testdef.impl.TestPlanImpl#getProjectVersion <em>Project Version</em>}</li>
 *   <li>{@link org.sgt.testdef.impl.TestPlanImpl#getCustomer <em>Customer</em>}</li>
 *   <li>{@link org.sgt.testdef.impl.TestPlanImpl#getTestPlanVersion <em>Test Plan Version</em>}</li>
 *   <li>{@link org.sgt.testdef.impl.TestPlanImpl#getRequirements <em>Requirements</em>}</li>
 *   <li>{@link org.sgt.testdef.impl.TestPlanImpl#getTestElements <em>Test Elements</em>}</li>
 *   <li>{@link org.sgt.testdef.impl.TestPlanImpl#getConditions <em>Conditions</em>}</li>
 *   <li>{@link org.sgt.testdef.impl.TestPlanImpl#getConstraints <em>Constraints</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class TestPlanImpl extends EObjectImpl implements TestPlan {
	/**
	 * The default value of the '{@link #getName() <em>Name</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getName()
	 * @generated
	 * @ordered
	 */
	protected static final String NAME_EDEFAULT = "<name>";

	/**
	 * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getName()
	 * @generated
	 * @ordered
	 */
	protected String name = NAME_EDEFAULT;

	/**
	 * The default value of the '{@link #getSummary() <em>Summary</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getSummary()
	 * @generated
	 * @ordered
	 */
	protected static final String SUMMARY_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getSummary() <em>Summary</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getSummary()
	 * @generated
	 * @ordered
	 */
	protected String summary = SUMMARY_EDEFAULT;

	/**
	 * The default value of the '{@link #getID() <em>ID</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getID()
	 * @generated
	 * @ordered
	 */
	protected static final String ID_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getID() <em>ID</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getID()
	 * @generated
	 * @ordered
	 */
	protected String id = ID_EDEFAULT;

	/**
	 * The cached value of the '{@link #getDescription() <em>Description</em>}' containment reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getDescription()
	 * @generated
	 * @ordered
	 */
	protected Description description;

	/**
	 * The cached value of the '{@link #getPreConditions() <em>Pre Conditions</em>}' reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getPreConditions()
	 * @generated
	 * @ordered
	 */
	protected EList<Condition> preConditions;

	/**
	 * The cached value of the '{@link #getPostConditions() <em>Post Conditions</em>}' reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getPostConditions()
	 * @generated
	 * @ordered
	 */
	protected EList<Condition> postConditions;

	/**
	 * The default value of the '{@link #getProject() <em>Project</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getProject()
	 * @generated
	 * @ordered
	 */
	protected static final String PROJECT_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getProject() <em>Project</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getProject()
	 * @generated
	 * @ordered
	 */
	protected String project = PROJECT_EDEFAULT;

	/**
	 * The default value of the '{@link #getProjectVersion() <em>Project Version</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getProjectVersion()
	 * @generated
	 * @ordered
	 */
	protected static final String PROJECT_VERSION_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getProjectVersion() <em>Project Version</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getProjectVersion()
	 * @generated
	 * @ordered
	 */
	protected String projectVersion = PROJECT_VERSION_EDEFAULT;

	/**
	 * The default value of the '{@link #getCustomer() <em>Customer</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getCustomer()
	 * @generated
	 * @ordered
	 */
	protected static final String CUSTOMER_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getCustomer() <em>Customer</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getCustomer()
	 * @generated
	 * @ordered
	 */
	protected String customer = CUSTOMER_EDEFAULT;

	/**
	 * The default value of the '{@link #getTestPlanVersion() <em>Test Plan Version</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getTestPlanVersion()
	 * @generated
	 * @ordered
	 */
	protected static final String TEST_PLAN_VERSION_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getTestPlanVersion() <em>Test Plan Version</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getTestPlanVersion()
	 * @generated
	 * @ordered
	 */
	protected String testPlanVersion = TEST_PLAN_VERSION_EDEFAULT;

	/**
	 * The cached value of the '{@link #getRequirements() <em>Requirements</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getRequirements()
	 * @generated
	 * @ordered
	 */
	protected EList<Requirement> requirements;

	/**
	 * The cached value of the '{@link #getTestElements() <em>Test Elements</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getTestElements()
	 * @generated
	 * @ordered
	 */
	protected EList<TestElement> testElements;

	/**
	 * The cached value of the '{@link #getConditions() <em>Conditions</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getConditions()
	 * @generated
	 * @ordered
	 */
	protected EList<TestCondition> conditions;

	/**
	 * The cached value of the '{@link #getConstraints() <em>Constraints</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getConstraints()
	 * @generated
	 * @ordered
	 */
	protected EList<TestConstraint> constraints;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected TestPlanImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return TestdefPackage.Literals.TEST_PLAN;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getName() {
		return name;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setName(String newName) {
		String oldName = name;
		name = newName;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, TestdefPackage.TEST_PLAN__NAME, oldName, name));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getSummary() {
		return summary;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setSummary(String newSummary) {
		String oldSummary = summary;
		summary = newSummary;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, TestdefPackage.TEST_PLAN__SUMMARY, oldSummary, summary));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated NOT
	 */
	public String getID() {
		if (id == null){
			setID("TP_" + this.hashCode());
		}
		return id;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setID(String newID) {
		String oldID = id;
		id = newID;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, TestdefPackage.TEST_PLAN__ID, oldID, id));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Description getDescription() {
		return description;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public NotificationChain basicSetDescription(Description newDescription, NotificationChain msgs) {
		Description oldDescription = description;
		description = newDescription;
		if (eNotificationRequired()) {
			ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, TestdefPackage.TEST_PLAN__DESCRIPTION, oldDescription, newDescription);
			if (msgs == null) msgs = notification; else msgs.add(notification);
		}
		return msgs;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setDescription(Description newDescription) {
		if (newDescription != description) {
			NotificationChain msgs = null;
			if (description != null)
				msgs = ((InternalEObject)description).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - TestdefPackage.TEST_PLAN__DESCRIPTION, null, msgs);
			if (newDescription != null)
				msgs = ((InternalEObject)newDescription).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - TestdefPackage.TEST_PLAN__DESCRIPTION, null, msgs);
			msgs = basicSetDescription(newDescription, msgs);
			if (msgs != null) msgs.dispatch();
		}
		else if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, TestdefPackage.TEST_PLAN__DESCRIPTION, newDescription, newDescription));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<Condition> getPreConditions() {
		if (preConditions == null) {
			preConditions = new EObjectResolvingEList<Condition>(Condition.class, this, TestdefPackage.TEST_PLAN__PRE_CONDITIONS);
		}
		return preConditions;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<Condition> getPostConditions() {
		if (postConditions == null) {
			postConditions = new EObjectResolvingEList<Condition>(Condition.class, this, TestdefPackage.TEST_PLAN__POST_CONDITIONS);
		}
		return postConditions;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getProject() {
		return project;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setProject(String newProject) {
		String oldProject = project;
		project = newProject;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, TestdefPackage.TEST_PLAN__PROJECT, oldProject, project));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getProjectVersion() {
		return projectVersion;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setProjectVersion(String newProjectVersion) {
		String oldProjectVersion = projectVersion;
		projectVersion = newProjectVersion;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, TestdefPackage.TEST_PLAN__PROJECT_VERSION, oldProjectVersion, projectVersion));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getCustomer() {
		return customer;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setCustomer(String newCustomer) {
		String oldCustomer = customer;
		customer = newCustomer;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, TestdefPackage.TEST_PLAN__CUSTOMER, oldCustomer, customer));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getTestPlanVersion() {
		return testPlanVersion;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setTestPlanVersion(String newTestPlanVersion) {
		String oldTestPlanVersion = testPlanVersion;
		testPlanVersion = newTestPlanVersion;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, TestdefPackage.TEST_PLAN__TEST_PLAN_VERSION, oldTestPlanVersion, testPlanVersion));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<Requirement> getRequirements() {
		if (requirements == null) {
			requirements = new EObjectContainmentEList<Requirement>(Requirement.class, this, TestdefPackage.TEST_PLAN__REQUIREMENTS);
		}
		return requirements;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<TestElement> getTestElements() {
		if (testElements == null) {
			testElements = new EObjectContainmentEList<TestElement>(TestElement.class, this, TestdefPackage.TEST_PLAN__TEST_ELEMENTS);
		}
		return testElements;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<TestCondition> getConditions() {
		if (conditions == null) {
			conditions = new EObjectContainmentEList<TestCondition>(TestCondition.class, this, TestdefPackage.TEST_PLAN__CONDITIONS);
		}
		return conditions;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<TestConstraint> getConstraints() {
		if (constraints == null) {
			constraints = new EObjectContainmentEList<TestConstraint>(TestConstraint.class, this, TestdefPackage.TEST_PLAN__CONSTRAINTS);
		}
		return constraints;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
		switch (featureID) {
			case TestdefPackage.TEST_PLAN__DESCRIPTION:
				return basicSetDescription(null, msgs);
			case TestdefPackage.TEST_PLAN__REQUIREMENTS:
				return ((InternalEList<?>)getRequirements()).basicRemove(otherEnd, msgs);
			case TestdefPackage.TEST_PLAN__TEST_ELEMENTS:
				return ((InternalEList<?>)getTestElements()).basicRemove(otherEnd, msgs);
			case TestdefPackage.TEST_PLAN__CONDITIONS:
				return ((InternalEList<?>)getConditions()).basicRemove(otherEnd, msgs);
			case TestdefPackage.TEST_PLAN__CONSTRAINTS:
				return ((InternalEList<?>)getConstraints()).basicRemove(otherEnd, msgs);
		}
		return super.eInverseRemove(otherEnd, featureID, msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case TestdefPackage.TEST_PLAN__NAME:
				return getName();
			case TestdefPackage.TEST_PLAN__SUMMARY:
				return getSummary();
			case TestdefPackage.TEST_PLAN__ID:
				return getID();
			case TestdefPackage.TEST_PLAN__DESCRIPTION:
				return getDescription();
			case TestdefPackage.TEST_PLAN__PRE_CONDITIONS:
				return getPreConditions();
			case TestdefPackage.TEST_PLAN__POST_CONDITIONS:
				return getPostConditions();
			case TestdefPackage.TEST_PLAN__PROJECT:
				return getProject();
			case TestdefPackage.TEST_PLAN__PROJECT_VERSION:
				return getProjectVersion();
			case TestdefPackage.TEST_PLAN__CUSTOMER:
				return getCustomer();
			case TestdefPackage.TEST_PLAN__TEST_PLAN_VERSION:
				return getTestPlanVersion();
			case TestdefPackage.TEST_PLAN__REQUIREMENTS:
				return getRequirements();
			case TestdefPackage.TEST_PLAN__TEST_ELEMENTS:
				return getTestElements();
			case TestdefPackage.TEST_PLAN__CONDITIONS:
				return getConditions();
			case TestdefPackage.TEST_PLAN__CONSTRAINTS:
				return getConstraints();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@SuppressWarnings("unchecked")
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case TestdefPackage.TEST_PLAN__NAME:
				setName((String)newValue);
				return;
			case TestdefPackage.TEST_PLAN__SUMMARY:
				setSummary((String)newValue);
				return;
			case TestdefPackage.TEST_PLAN__ID:
				setID((String)newValue);
				return;
			case TestdefPackage.TEST_PLAN__DESCRIPTION:
				setDescription((Description)newValue);
				return;
			case TestdefPackage.TEST_PLAN__PRE_CONDITIONS:
				getPreConditions().clear();
				getPreConditions().addAll((Collection<? extends Condition>)newValue);
				return;
			case TestdefPackage.TEST_PLAN__POST_CONDITIONS:
				getPostConditions().clear();
				getPostConditions().addAll((Collection<? extends Condition>)newValue);
				return;
			case TestdefPackage.TEST_PLAN__PROJECT:
				setProject((String)newValue);
				return;
			case TestdefPackage.TEST_PLAN__PROJECT_VERSION:
				setProjectVersion((String)newValue);
				return;
			case TestdefPackage.TEST_PLAN__CUSTOMER:
				setCustomer((String)newValue);
				return;
			case TestdefPackage.TEST_PLAN__TEST_PLAN_VERSION:
				setTestPlanVersion((String)newValue);
				return;
			case TestdefPackage.TEST_PLAN__REQUIREMENTS:
				getRequirements().clear();
				getRequirements().addAll((Collection<? extends Requirement>)newValue);
				return;
			case TestdefPackage.TEST_PLAN__TEST_ELEMENTS:
				getTestElements().clear();
				getTestElements().addAll((Collection<? extends TestElement>)newValue);
				return;
			case TestdefPackage.TEST_PLAN__CONDITIONS:
				getConditions().clear();
				getConditions().addAll((Collection<? extends TestCondition>)newValue);
				return;
			case TestdefPackage.TEST_PLAN__CONSTRAINTS:
				getConstraints().clear();
				getConstraints().addAll((Collection<? extends TestConstraint>)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case TestdefPackage.TEST_PLAN__NAME:
				setName(NAME_EDEFAULT);
				return;
			case TestdefPackage.TEST_PLAN__SUMMARY:
				setSummary(SUMMARY_EDEFAULT);
				return;
			case TestdefPackage.TEST_PLAN__ID:
				setID(ID_EDEFAULT);
				return;
			case TestdefPackage.TEST_PLAN__DESCRIPTION:
				setDescription((Description)null);
				return;
			case TestdefPackage.TEST_PLAN__PRE_CONDITIONS:
				getPreConditions().clear();
				return;
			case TestdefPackage.TEST_PLAN__POST_CONDITIONS:
				getPostConditions().clear();
				return;
			case TestdefPackage.TEST_PLAN__PROJECT:
				setProject(PROJECT_EDEFAULT);
				return;
			case TestdefPackage.TEST_PLAN__PROJECT_VERSION:
				setProjectVersion(PROJECT_VERSION_EDEFAULT);
				return;
			case TestdefPackage.TEST_PLAN__CUSTOMER:
				setCustomer(CUSTOMER_EDEFAULT);
				return;
			case TestdefPackage.TEST_PLAN__TEST_PLAN_VERSION:
				setTestPlanVersion(TEST_PLAN_VERSION_EDEFAULT);
				return;
			case TestdefPackage.TEST_PLAN__REQUIREMENTS:
				getRequirements().clear();
				return;
			case TestdefPackage.TEST_PLAN__TEST_ELEMENTS:
				getTestElements().clear();
				return;
			case TestdefPackage.TEST_PLAN__CONDITIONS:
				getConditions().clear();
				return;
			case TestdefPackage.TEST_PLAN__CONSTRAINTS:
				getConstraints().clear();
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case TestdefPackage.TEST_PLAN__NAME:
				return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
			case TestdefPackage.TEST_PLAN__SUMMARY:
				return SUMMARY_EDEFAULT == null ? summary != null : !SUMMARY_EDEFAULT.equals(summary);
			case TestdefPackage.TEST_PLAN__ID:
				return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id);
			case TestdefPackage.TEST_PLAN__DESCRIPTION:
				return description != null;
			case TestdefPackage.TEST_PLAN__PRE_CONDITIONS:
				return preConditions != null && !preConditions.isEmpty();
			case TestdefPackage.TEST_PLAN__POST_CONDITIONS:
				return postConditions != null && !postConditions.isEmpty();
			case TestdefPackage.TEST_PLAN__PROJECT:
				return PROJECT_EDEFAULT == null ? project != null : !PROJECT_EDEFAULT.equals(project);
			case TestdefPackage.TEST_PLAN__PROJECT_VERSION:
				return PROJECT_VERSION_EDEFAULT == null ? projectVersion != null : !PROJECT_VERSION_EDEFAULT.equals(projectVersion);
			case TestdefPackage.TEST_PLAN__CUSTOMER:
				return CUSTOMER_EDEFAULT == null ? customer != null : !CUSTOMER_EDEFAULT.equals(customer);
			case TestdefPackage.TEST_PLAN__TEST_PLAN_VERSION:
				return TEST_PLAN_VERSION_EDEFAULT == null ? testPlanVersion != null : !TEST_PLAN_VERSION_EDEFAULT.equals(testPlanVersion);
			case TestdefPackage.TEST_PLAN__REQUIREMENTS:
				return requirements != null && !requirements.isEmpty();
			case TestdefPackage.TEST_PLAN__TEST_ELEMENTS:
				return testElements != null && !testElements.isEmpty();
			case TestdefPackage.TEST_PLAN__CONDITIONS:
				return conditions != null && !conditions.isEmpty();
			case TestdefPackage.TEST_PLAN__CONSTRAINTS:
				return constraints != null && !constraints.isEmpty();
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) {
		if (baseClass == ConditionableObject.class) {
			switch (derivedFeatureID) {
				case TestdefPackage.TEST_PLAN__PRE_CONDITIONS: return CoredefPackage.CONDITIONABLE_OBJECT__PRE_CONDITIONS;
				case TestdefPackage.TEST_PLAN__POST_CONDITIONS: return CoredefPackage.CONDITIONABLE_OBJECT__POST_CONDITIONS;
				default: return -1;
			}
		}
		return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) {
		if (baseClass == ConditionableObject.class) {
			switch (baseFeatureID) {
				case CoredefPackage.CONDITIONABLE_OBJECT__PRE_CONDITIONS: return TestdefPackage.TEST_PLAN__PRE_CONDITIONS;
				case CoredefPackage.CONDITIONABLE_OBJECT__POST_CONDITIONS: return TestdefPackage.TEST_PLAN__POST_CONDITIONS;
				default: return -1;
			}
		}
		return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (name: ");
		result.append(name);
		result.append(", summary: ");
		result.append(summary);
		result.append(", ID: ");
		result.append(id);
		result.append(", project: ");
		result.append(project);
		result.append(", projectVersion: ");
		result.append(projectVersion);
		result.append(", customer: ");
		result.append(customer);
		result.append(", testPlanVersion: ");
		result.append(testPlanVersion);
		result.append(')');
		return result.toString();
	}

} //TestPlanImpl
